<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>AngularJS Scope</title>
		<style>
			body{
			  font-family: 'microsoft yahei',Arial,sans-serif;
			}
			
			h1{
			  font-weight:500;
			  font-size:24px;
			}
		</style>
	</head>

	<body>
		<h1>AngularJS Scope演示</h1>

		<div ng-app="mainApp" ng-controller="shapeController">
		
		  <div>
		    <p>{{message}} <br/> {{type}} </p>
		  </div>
		  <hr>
		  
		  <div ng-controller="circleController">
		    <p>{{message}} <br/> {{type}} </p>
		  </div>
		  <hr>
		  
		  <div ng-controller="squareController">
		    <p>{{message}} <br/> {{type}} </p>
		  </div>
		  
		</div>
		
		<script src="http://cdn.gbtags.com/angular.js/1.2.20/angular.min.js"></script>
		<script>
			var mainApp = angular.module("mainApp", []);
			
			mainApp.controller("shapeController", function($scope){
				$scope.message = 'shapeController控制器';
				$scope.type = 'shapeController控制器';
			});
			
			mainApp.controller("circleController", function($scope){
				$scope.message = 'circleController控制器';
				$scope.type = 'circleController控制器';
			});
			
			mainApp.controller("squareController", function($scope){
				$scope.type = 'squareController控制器';
			});
		</script>
	</body>

</html>